<?php
/**
 * @Notes: 文件描述
 * @Interface getCondition
 * @Return mixed
 * @Author: fc
 * @Time: 2021/9/22 20:34
 */

namespace app\common\model;


use think\Model;
use think\Facade\Cache;

class Goods extends Model
{

    public static function init()
    {
        self::event('before_insert', function ($data) {
            $data['goods_title'] = '糖豆';
            $data['goods_img'] = 'http://www.zerofc.cn/jiajdefe.png';
            $data['goods_desc'] = '我只是商品描述';
        });


        self::event('after_write', function() {

            Cache::store('redis')->del('hello');

        });
    }

}